<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@page import="com.gdit.zax.utils.UrlDecoder"%>
<%@page import="java.sql.Connection"%>
<%@page import="com.gdit.zax.utils.DBUtil"%>
<%@page import="com.gdit.zax.utils.Repost"%>
<%@page import="com.gdit.zax.dao.SchoolDao"%>
<%@page import="com.gdit.zax.factory.DAOFactory"%>
<%
	Connection conn = DBUtil.getConnection();
	if (conn==null) {
		Repost.dberror(request,response);
		return;
	}
	
	SchoolDao school = DAOFactory.init(conn,request,response).getSchoolDao();
	request.setAttribute("data",school.getAllSchool());
 %>

<script language="javascript">
function disa()
{
	document.
    document.all.btn_submit.disabled;
}
</script>




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>注册首页</title>
		<link href="css/style.css" rel="stylesheet" type="text/css">
	</head>

	<body>
	<!-- 
	1:${requestScope.accesstoken}
    2:${sessionScope.accesstoken}
    3:${session.accesstoken}
    4:${param.accesstoken}
    				<input type="hidden" name="accesstoken" value="${param.accesstoken}"/>  
	 -->

		<center>
			<h1>用户注册</h1>
				<form action="servlet_register" method="post" enctype="multipart/form-data"> 
				

				<p>
					账号:
					<input type="text" name="name"/>*
				<p>
					密码:
					<input type="password" name="pwd"/>*
				<p>
									确认密码:
					<input type="password" name="pwd2" />*
				<p>所在学校:
				<select name="schoolid">
				<option value="-1" selected="selected">请选择学校</option>
				<c:forEach var="list" items="${requestScope.data}" varStatus="index">
					<c:choose>
						<c:when test="${index.index == -1 }">
							<option value="${list.id}" selected="selected">
								${list.name}
							</option>
						</c:when>
						<c:otherwise>
							<option value="${list.id}">
								${list.name}
							</option>
						</c:otherwise>
					</c:choose>
				</c:forEach>
			</select> 
							</p>
							email: 
					<input type="text" name="email" />*
				<p>
					性别: &nbsp;男 
					<input type="radio" value="0" name="sex" checked="checked"> 
					&nbsp;&nbsp;女 
					<input type="radio" value="1" name="sex"> 
					&nbsp;&nbsp;
				</p>
				<p>年龄:<input type="text" name="age"></p>
				
				<p>&nbsp; 
					头像： 
					<input type="file" name="pic" size="10" accept=".jpg,.bmp,.gif,.png">
				</p>

				<input name="btn_submit" type="submit" value="注册"/>
				<input type="reset" value="重置" />
				
			</form>
		</center>
	</body>
</html>
